package com.woniu.controller;

import com.woniu.entity.Food;
import com.woniu.service.FoodService;
import com.woniu.util.ResponseEnum;
import com.woniu.util.ResponseUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Classname FoodController
 * @Description TODO
 * @Date 2025/7/22 10:42
 * @Created by pc
 */
@RestController
@RequestMapping("/food")
public class FoodController {

    @Resource
    private FoodService foodService;

    @GetMapping
    public ResponseUtil findAll(){
        List<Food> list = foodService.list();
        return ResponseUtil.get(ResponseEnum.OK,list);
    }
}
